package org.distributed.security.client1.controller;

import javax.servlet.http.HttpSession;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class SystemLoginController {

	/**
	 * 目的是想，注销会话，然后跳转到对应的登录页面，但是没有生效
	 * @return
	 */
	@GetMapping("/logout")
	public String logout(HttpSession session){
		SecurityContextHolder.clearContext();
		session.invalidate();
		return "redirect:/login";
	}
	
}
